<?php

/**
 * Proveedores form base class.
 *
 * @package    tercermilenio
 * @subpackage form
 * @author     Your name here
 */
class BaseProveedoresForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'pvd_id'            => new sfWidgetFormInputHidden(),
      'pvd_nro_documento' => new sfWidgetFormInput(),
      'pvd_nombre'        => new sfWidgetFormInput(),
      'pvd_direccion'     => new sfWidgetFormInput(),
      'pvd_localidad'     => new sfWidgetFormPropelChoice(array('model' => 'Localidades', 'add_empty' => true)),
      'pvd_telefono'      => new sfWidgetFormInput(),
      'pvd_celular'       => new sfWidgetFormInput(),
      'pvd_mail'          => new sfWidgetFormInput(),
      'pvd_estado'        => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'pvd_id'            => new sfValidatorPropelChoice(array('model' => 'Proveedores', 'column' => 'pvd_id', 'required' => false)),
      'pvd_nro_documento' => new sfValidatorString(array('max_length' => 13)),
      'pvd_nombre'        => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'pvd_direccion'     => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'pvd_localidad'     => new sfValidatorPropelChoice(array('model' => 'Localidades', 'column' => 'loc_id', 'required' => false)),
      'pvd_telefono'      => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'pvd_celular'       => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'pvd_mail'          => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'pvd_estado'        => new sfValidatorString(array('max_length' => 255, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('proveedores[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Proveedores';
  }


}
